#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    char ch;
    cin>>n>>ch;
    if(n==1){
        cout<<ch<<endl<<"0";
        return 0;
    }
    int k=0;
    while(2*(k*k)-1<n){
        k++;
    }
    k--;
    for(int i=k;i>=2;i--){
        for(int j=0;j<k-i;j++)cout<<" ";
        for(int j=0;j<2*i-1;j++)cout<<ch;
        cout<<endl;
    }
    for(int i=1;i<k;i++)cout<<" ";
    cout<<ch<<endl;
    for(int i=2;i<=k;i++){
        for(int j=0;j<k-i;j++)cout<<" ";
        for(int j=0;j<2*i-1;j++)cout<<ch;
        cout<<endl;
    }
    cout<<n-(2*k*k-1)<<endl;
    
    return 0;
}